import Vue from 'vue'
import VueRouter from 'vue-router'
import discovery from '../views/discovery/discovery.vue'
import recommend from '../components/discovery/recommend.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '*',
    redirect: '/home'
  },
  {
    path: '/',
    component: discovery,
    redirect: '/home',
    children: [
      {
        path: '/home',
        name: 'recommend',
        component: recommend
      },
      {
        path: '/musicdetails',
        component: () => import('../components/common/musicdetails.vue')
      },
      {
        path: '/home/toplist',
        component: () => import('../components/discovery/toplist.vue'),
        meta: { id: 0 }
      }
    ]
  },
  {
    path: '/podcast',
    component: () => import('../views/podcast/podcast.vue')
  },
  {
    path: '/video',
    component: () => import('../views/videoKMusic/video.vue')
  },
  {
    path: '/concern',
    component: () => import('../views/concern/concern.vue')
  },
  {
    path: '/streams',
    component: () => import('../views/streams/streams.vue')
  },
  {
    path: '/privatefm',
    component: () => import('../views/privatefm/privatefm.vue')
  },
  {
    path: '/mylikemusic',
    component: () => import('../views/mymusic/mymusic.vue')
  },
  {
    path: '/search',
    component: () => import('../components/search/searchResult.vue')
  }

]

const router = new VueRouter({

  routes
})

export default router
